Getting started: Add docs about desktop file and icon
authorMatthias Clasen <mclasen@redhat.com>
Wed, 24 Jul 2013 04:07:41 +0000 (00:07 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Wed, 24 Jul 2013 11:31:05 +0000 (07:31 -0400)
docs/reference/gtk/Makefile.am
docs/reference/gtk/getting_started.xml
docs/reference/gtk/images/exampleapp.png [new file with mode: 0644]

index e2fff14dc0995ea3fbf56345b8a302b94f451e27..4848ee55a9536a186b55c8bf9e5e801c882f9981 100644 (file)
@@ -419,7 +419,8 @@ HTML_IMAGES = \
        $(srcdir)/images/getting-started-app4.png                       \
        $(srcdir)/images/getting-started-app6.png                       \
        $(srcdir)/images/getting-started-app7.png                       \
-       $(srcdir)/images/getting-started-app8.png
+       $(srcdir)/images/getting-started-app8.png                       \
+       $(srcdir)/images/exampleapp.png
 
 # Extra options to supply to gtkdoc-fixref
 FIXXREF_OPTIONS=--extra-dir=../gdk/html \
index 2bd5006deb471ba4489eb381a6d7b15653597866..9baa5b455fe74092e578a9611cbbc0e5d8b0752a 100644 (file)
   <section>
     <title>Building applications</title>
 
+    <para>An application consists of a number of files:
+    <variablelist>
+      <varlistentry>
+        <term>The binary</term>
+        <listitem>This gets installed in <filename>/usr/bin</filename>.</listitem>
+      </varlistentry>
+      <varlistentry>
+        <term>A desktop file</term>
+        <listitem>The desktop file provides important information about the application to the desktop shell, such as its name, icon, D-Bus name, commandline to launch it, etc. It is installed in <filename>/usr/share/applications</filename>.</listitem>
+      </varlistentry>
+      <varlistentry>
+        <term>An icon</term>
+        <listitem>The icon gets installed in <filename>/usr/share/icons/hicolor/48x48/apps</filename>, where it will be found regardless of the current theme.</listitem>
+      </varlistentry>
+      <varlistentry>
+        <term>A settings schema</term>
+        <listitem>If the application uses GSettings, it will install its schema
+          in <filename>/usr/share/glib-2.0/schemas</filename>, so that tools
+          like dconf-editor can find it.</listitem>
+      </varlistentry>
+      <varlistentry>
+        <term>Other resources</term>
+        <listitem>Other files, such as GtkBuilder ui files, are best loaded from
+          resources stored in the application binary itself. This eliminates the
+          need for most of the files that would traditionally be installed in
+          an application-specific location in <filename>/usr/share</filename>.</listitem>
+      </varlistentry>
+    </variablelist>
+    </para>
+
     <para>GTK+ includes application support that is built on top of
     #GApplication. In this tutorial we'll build a simple application by
     starting from scratch, adding more and more pieces over time. Along
         <programlisting><xi:include href="../../../../examples/application1/exampleappwin.c" parse="text"><xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
       </informalexample>
 
+      <para>As part of the initial setup of our application, we also
+      create an icon and a desktop file.</para>
+
+      <informalfigure>
+        <mediaobject>
+          <imageobject>
+            <imagedata fileref="exampleapp.png" format="PNG"/>
+          </imageobject>
+        </mediaobject>
+      </informalfigure>
+
+      <informalexample>
+        <programlisting><xi:include href="../../../../examples/application1/exampleapp.desktop" parse="text"><xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
+      </informalexample>
+
+      <para>Note that <replaceable>@<!-- -->bindir@</replaceable> needs to be replaced
+      with the actual path to the binary before this desktop file can be used.</para>
+
       <para>Here is what we've achieved so far:</para>
 
       <informalfigure>
diff --git a/docs/reference/gtk/images/exampleapp.png b/docs/reference/gtk/images/exampleapp.png
new file mode 100644 (file)
index 0000000..8beb54e
Binary files /dev/null and b/docs/reference/gtk/images/exampleapp.png differ